package com.happy016.feign;

import com.happy016.pojo.User;
import org.springframework.stereotype.Component;

/**
 * feign fall back 回退
 * @author Linyb
 * @since 2017/10/10 14:00
 */
@Component
public class UserFeignFallBack implements UserFeignClient {

    /**
     * findById  fall back 回退执行方法
     * @author Linyb
     * @since 2017/10/10 14:01
     */
    @Override
    public User findById(Integer id) {
        User user = new User();
        user.setId(id);
        user.setUsername("Hystrix-UserFeignFallBack");
        return user;
    }
}
